<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019\6\10 0010
 * Time: 22:01
 */

namespace BigVideo\IMooc;

/**
 * 注册树模式----相当于symfony里面的注册服务
 * Class Register
 * @package BigVideo\IMooc
 */
class Register
{
    protected static $objects;

    public static function set($alias,$object){
        self::$objects[$alias] = $object;
    }

    public static function get($alias){
        return isset(self::$objects[$alias])?self::$objects[$alias]:null;
    }

    public function _unset($alias){
        unset(self::$objects[$alias]);
    }
}